<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
      <title>GTL - Graph Template Library: graph.h Source File</title>
      <link href="doxygen.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <p class="links">  
      <a href="../index.html">Home</a> |
      Documentation |
      <a href="../register.html">Download</a> |
      <a href="../platforms.html">Platforms</a> |
      <a href="../refer.html">Projects</a> |      
      <a href="../lists.html">Mailing Lists</a> |
      <a href="../history.html">Version History</a>
    </p>

<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>graph.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">//   graph.h</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
<a name="l00006"></a>00006 <span class="comment">// $Id: graph.h,v 1.43 2002/11/06 08:49:35 raitner Exp $</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef GTL_GRAPH_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define GTL_GRAPH_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;GTL/GTL.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;GTL/node.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;GTL/edge.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;GTL/edge_map.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;GTL/node_map.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;GTL/gml_parser.h&gt;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00020"></a>00020 
<a name="l00021"></a>00021 __GTL_BEGIN_NAMESPACE
<a name="l00022"></a>00022 
<a name="l00041"></a><a class="code" href="a00014.html">00041</a> <span class="keyword">class </span>GTL_EXTERN <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>
<a name="l00042"></a>00042 {
<a name="l00043"></a>00043 <span class="keyword">public</span>:
<a name="l00044"></a>00044     <span class="comment">//================================================== Con-/Destructors</span>
<a name="l00045"></a>00045 
<a name="l00049"></a>00049     <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>();
<a name="l00050"></a>00050 
<a name="l00062"></a>00062     <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a> (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00063"></a>00063     
<a name="l00073"></a>00073     <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a> (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, <span class="keyword">const</span> list&lt;node&gt;&amp; nodes);
<a name="l00074"></a>00074     
<a name="l00085"></a>00085     <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a> (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, 
<a name="l00086"></a>00086         list&lt;node&gt;::const_iterator it, 
<a name="l00087"></a>00087         list&lt;node&gt;::const_iterator end);
<a name="l00088"></a>00088     
<a name="l00092"></a>00092     <span class="keyword">virtual</span> ~<a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>();
<a name="l00093"></a>00093     
<a name="l00094"></a>00094     <span class="comment">//================================================== Directed/Undirected</span>
<a name="l00095"></a>00095 
<a name="l00099"></a>00099     <span class="keywordtype">void</span> make_directed();
<a name="l00100"></a>00100 
<a name="l00104"></a>00104     <span class="keywordtype">void</span> make_undirected();
<a name="l00105"></a>00105 
<a name="l00106"></a>00106     <span class="comment">//================================================== Tests / Information</span>
<a name="l00107"></a>00107     
<a name="l00113"></a>00113     <span class="keywordtype">bool</span> is_directed() <span class="keyword">const</span>;
<a name="l00114"></a>00114 
<a name="l00120"></a>00120     <span class="keywordtype">bool</span> is_undirected() <span class="keyword">const</span>;
<a name="l00121"></a>00121 
<a name="l00133"></a>00133     <span class="keywordtype">bool</span> is_bidirected(<a class="code" href="a00011.html" title="A specialized map with edges as keys.">edge_map&lt;edge&gt;</a>&amp; rev) <span class="keyword">const</span>;
<a name="l00134"></a>00134 
<a name="l00142"></a>00142     <span class="keywordtype">bool</span> is_connected() <span class="keyword">const</span>;
<a name="l00143"></a>00143 
<a name="l00150"></a>00150     <span class="keywordtype">bool</span> is_acyclic() <span class="keyword">const</span>;
<a name="l00151"></a>00151 
<a name="l00157"></a>00157     <span class="keywordtype">int</span> number_of_nodes() <span class="keyword">const</span>;
<a name="l00158"></a>00158 
<a name="l00164"></a>00164     <span class="keywordtype">int</span> number_of_edges() <span class="keyword">const</span>;
<a name="l00165"></a>00165 
<a name="l00172"></a>00172     <a class="code" href="a00020.html" title="A node in a graph.">node</a> center() <span class="keyword">const</span>;
<a name="l00173"></a>00173 
<a name="l00174"></a>00174     <span class="comment">//================================================== Creation</span>
<a name="l00175"></a>00175     
<a name="l00181"></a>00181     <span class="keyword">virtual</span> <a class="code" href="a00020.html" title="A node in a graph.">node</a> new_node();
<a name="l00182"></a>00182     
<a name="l00194"></a>00194     <span class="keyword">virtual</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> new_edge(<a class="code" href="a00020.html" title="A node in a graph.">node</a> s, <a class="code" href="a00020.html" title="A node in a graph.">node</a> t);
<a name="l00195"></a>00195 
<a name="l00199"></a>00199     <span class="keyword">virtual</span> <a class="code" href="a00010.html" title="An edge in a graph.">edge</a> new_edge(<span class="keyword">const</span> list&lt;node&gt; &amp;sources, <span class="keyword">const</span> list&lt;node&gt; &amp;targets);
<a name="l00200"></a>00200 
<a name="l00201"></a>00201     <span class="comment">//================================================== Deletion</span>
<a name="l00202"></a>00202 
<a name="l00213"></a>00213     <span class="keywordtype">void</span> del_node(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
<a name="l00214"></a>00214 
<a name="l00219"></a>00219     <span class="keywordtype">void</span> del_all_nodes(); 
<a name="l00220"></a>00220 
<a name="l00230"></a>00230     <span class="keywordtype">void</span> del_edge(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00231"></a>00231 
<a name="l00236"></a>00236     <span class="keywordtype">void</span> del_all_edges(); 
<a name="l00237"></a>00237 
<a name="l00241"></a>00241     <span class="keywordtype">void</span> clear();
<a name="l00242"></a>00242 
<a name="l00243"></a>00243     <span class="comment">//================================================== Iterators</span>
<a name="l00244"></a>00244 
<a name="l00248"></a>00248     <span class="keyword">typedef</span> list&lt;node&gt;::const_iterator node_iterator;
<a name="l00252"></a>00252     <span class="keyword">typedef</span> list&lt;edge&gt;::const_iterator edge_iterator;
<a name="l00253"></a>00253     
<a name="l00259"></a>00259     node_iterator nodes_begin() <span class="keyword">const</span>;
<a name="l00260"></a>00260     
<a name="l00266"></a>00266     node_iterator nodes_end() <span class="keyword">const</span>;
<a name="l00267"></a>00267     
<a name="l00273"></a>00273     edge_iterator edges_begin() <span class="keyword">const</span>;
<a name="l00274"></a>00274     
<a name="l00280"></a>00280     edge_iterator edges_end() <span class="keyword">const</span>;
<a name="l00281"></a>00281 
<a name="l00282"></a>00282     <span class="comment">//================================================== get nodes/edges</span>
<a name="l00283"></a>00283 
<a name="l00288"></a>00288     list&lt;node&gt; all_nodes() <span class="keyword">const</span>;
<a name="l00289"></a>00289 
<a name="l00294"></a>00294     list&lt;edge&gt; all_edges() <span class="keyword">const</span>;
<a name="l00295"></a>00295  
<a name="l00299"></a>00299     <a class="code" href="a00020.html" title="A node in a graph.">node</a> choose_node () <span class="keyword">const</span>;
<a name="l00300"></a>00300     
<a name="l00301"></a>00301     <span class="comment">//================================================== Hide / Restore</span>
<a name="l00302"></a>00302 
<a name="l00311"></a>00311     <span class="keywordtype">void</span> hide_edge (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00312"></a>00312     
<a name="l00321"></a>00321     <span class="keywordtype">void</span> restore_edge (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e);
<a name="l00322"></a>00322 
<a name="l00334"></a>00334     list&lt;edge&gt; hide_node (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
<a name="l00335"></a>00335 
<a name="l00346"></a>00346     <span class="keywordtype">void</span> restore_node (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n);
<a name="l00347"></a>00347 
<a name="l00359"></a>00359     <span class="keywordtype">void</span> induced_subgraph (list&lt;node&gt;&amp; subgraph_nodes);
<a name="l00360"></a>00360 
<a name="l00371"></a>00371     <span class="keywordtype">void</span> restore_graph ();
<a name="l00372"></a>00372 
<a name="l00373"></a>00373     <span class="comment">//================================================== Others</span>
<a name="l00374"></a>00374 
<a name="l00380"></a>00380     list&lt;edge&gt; insert_reverse_edges();
<a name="l00381"></a>00381     
<a name="l00382"></a>00382     <span class="comment">//================================================== I/O</span>
<a name="l00383"></a>00383 
<a name="l00400"></a><a class="code" href="a00014.html#93a350b8ce63ef0b0545722ba519fd3d">00400</a>     <a class="code" href="a00013.html" title="Reason and position of an error in a GML file.">GML_error</a> load (<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; filename, <span class="keywordtype">bool</span> preserve_ids = <span class="keyword">false</span>) 
<a name="l00401"></a>00401         { <span class="keywordflow">return</span> load (filename.c_str(), preserve_ids); }
<a name="l00402"></a>00402 
<a name="l00403"></a>00403     
<a name="l00420"></a>00420     <a class="code" href="a00013.html" title="Reason and position of an error in a GML file.">GML_error</a> load (<span class="keyword">const</span> <span class="keywordtype">char</span>* filename, <span class="keywordtype">bool</span> preserve_ids = <span class="keyword">false</span>);
<a name="l00421"></a>00421 
<a name="l00430"></a>00430     <span class="keywordtype">int</span> save (<span class="keyword">const</span> <span class="keywordtype">char</span>* filename) <span class="keyword">const</span>;
<a name="l00431"></a>00431 
<a name="l00438"></a>00438     <span class="keywordtype">void</span> save (ostream* file = &amp;cout) <span class="keyword">const</span>;
<a name="l00439"></a>00439 
<a name="l00440"></a>00440     <span class="comment">//================================================== Node handlers</span>
<a name="l00441"></a>00441     
<a name="l00448"></a><a class="code" href="a00014.html#fb7606eaa8d673b6599af24437c0546c">00448</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_new_node_handler() {}
<a name="l00449"></a>00449 
<a name="l00457"></a><a class="code" href="a00014.html#63b7354fbe3614748cc27340e99ff919">00457</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_new_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
<a name="l00458"></a>00458 
<a name="l00466"></a><a class="code" href="a00014.html#06f8fe6d5ee6bef9066f78a0b95c083a">00466</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_del_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}        
<a name="l00467"></a>00467 
<a name="l00474"></a><a class="code" href="a00014.html#4e08a559e3f1007a1a16a53c9a15cb0f">00474</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_del_node_handler() {}             
<a name="l00475"></a>00475 
<a name="l00483"></a><a class="code" href="a00014.html#96e6fadc8e77bde74448d4ba4b873628">00483</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_hide_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}          
<a name="l00484"></a>00484 
<a name="l00492"></a><a class="code" href="a00014.html#89cd4d0acb9a82a85ba7845a92a68044">00492</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_hide_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}         
<a name="l00493"></a>00493 
<a name="l00501"></a><a class="code" href="a00014.html#7da481e2f363380343a68d52acc8473b">00501</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_restore_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}       
<a name="l00502"></a>00502  
<a name="l00510"></a><a class="code" href="a00014.html#d0fd5fc9618111890b596601b6273713">00510</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_restore_node_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> n) {}
<a name="l00511"></a>00511 
<a name="l00512"></a>00512    <span class="comment">//================================================== Edge handlers</span>
<a name="l00513"></a>00513 
<a name="l00522"></a><a class="code" href="a00014.html#e57c6789ea5945e32fca200163e44d8b">00522</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_new_edge_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a> s, <a class="code" href="a00020.html" title="A node in a graph.">node</a> t) {}    
<a name="l00523"></a>00523 
<a name="l00531"></a><a class="code" href="a00014.html#88f098d412bcbacba975e70be8d1a892">00531</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_new_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}          
<a name="l00532"></a>00532 
<a name="l00540"></a><a class="code" href="a00014.html#413590984a00770927ba619c409a7b57">00540</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_del_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}           
<a name="l00541"></a>00541 
<a name="l00550"></a><a class="code" href="a00014.html#b9ac8bcc7288986de69cd467beb33600">00550</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_del_edge_handler(<a class="code" href="a00020.html" title="A node in a graph.">node</a>, <a class="code" href="a00020.html" title="A node in a graph.">node</a>) {}
<a name="l00551"></a>00551     
<a name="l00559"></a><a class="code" href="a00014.html#d755188a78a38f733cf362d4e8dd47f8">00559</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_hide_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}          
<a name="l00560"></a>00560 
<a name="l00568"></a><a class="code" href="a00014.html#7554deb5a22be446b2b423f2ce481c64">00568</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_hide_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}         
<a name="l00569"></a>00569 
<a name="l00577"></a><a class="code" href="a00014.html#4c3634093c7d8877b6c229bcbfa4702b">00577</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_restore_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}       
<a name="l00578"></a>00578  
<a name="l00586"></a><a class="code" href="a00014.html#8c0f68bcd054fc2736716996bbf56472">00586</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_restore_edge_handler(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e) {}
<a name="l00587"></a>00587 
<a name="l00588"></a>00588     <span class="comment">//================================================== Global handlers</span>
<a name="l00589"></a>00589     
<a name="l00600"></a><a class="code" href="a00014.html#16ccad78837d16be59854549cd2d847a">00600</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_clear_handler()  {}
<a name="l00601"></a>00601 
<a name="l00612"></a><a class="code" href="a00014.html#870633528590b7925cd27776bdd2bbd2">00612</a>    <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_clear_handler() {} 
<a name="l00613"></a>00613 
<a name="l00621"></a><a class="code" href="a00014.html#505198f412b1e426e9d09b62ea9811e8">00621</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_make_directed_handler()  {}
<a name="l00622"></a>00622 
<a name="l00630"></a><a class="code" href="a00014.html#43dc35def3d8125eb8f3841d55e0b1c8">00630</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_make_directed_handler()  {}
<a name="l00631"></a>00631 
<a name="l00639"></a><a class="code" href="a00014.html#8964107991e6f411ba8992f6b1deda21">00639</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_make_undirected_handler()  {}
<a name="l00640"></a>00640 
<a name="l00648"></a><a class="code" href="a00014.html#3d2bc348d12931aff1d2e97a6b4285c3">00648</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> post_make_undirected_handler()  {}
<a name="l00649"></a>00649 
<a name="l00650"></a>00650 
<a name="l00651"></a>00651     <span class="comment">//================================================== I/O - Handler </span>
<a name="l00652"></a>00652 
<a name="l00661"></a><a class="code" href="a00014.html#81300befaa8bc1525793f4849f1473a5">00661</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> pre_graph_save_handler (ostream* os)<span class="keyword"> const </span>{ };
<a name="l00662"></a>00662 
<a name="l00672"></a><a class="code" href="a00014.html#daf1ba615a8647485b89e94cdb6ae209">00672</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> save_graph_info_handler (ostream*)<span class="keyword"> const </span>{ };
<a name="l00673"></a>00673     
<a name="l00683"></a><a class="code" href="a00014.html#9ff703e09f902bf431664587057081ca">00683</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> save_node_info_handler (ostream*, <a class="code" href="a00020.html" title="A node in a graph.">node</a>)<span class="keyword"> const </span>{ };
<a name="l00684"></a>00684 
<a name="l00694"></a><a class="code" href="a00014.html#9623957f45c2bc7c6042fd22c8a86241">00694</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> save_edge_info_handler (ostream*, <a class="code" href="a00010.html" title="An edge in a graph.">edge</a>)<span class="keyword"> const </span>{ };
<a name="l00695"></a>00695 
<a name="l00704"></a><a class="code" href="a00014.html#adf85f37373798a6c53be7c0a5e98025">00704</a>     <span class="keyword">virtual</span> <span class="keywordtype">void</span> after_graph_save_handler (ostream* )<span class="keyword"> const </span>{ };
<a name="l00705"></a>00705 
<a name="l00715"></a>00715     <span class="keyword">virtual</span> <span class="keywordtype">void</span> top_level_key_handler (GML_pair* list);
<a name="l00716"></a>00716 
<a name="l00727"></a>00727     <span class="keyword">virtual</span> <span class="keywordtype">void</span> load_node_info_handler (<a class="code" href="a00020.html" title="A node in a graph.">node</a> n, GML_pair* list );
<a name="l00728"></a>00728     
<a name="l00739"></a>00739     <span class="keyword">virtual</span> <span class="keywordtype">void</span> load_edge_info_handler (<a class="code" href="a00010.html" title="An edge in a graph.">edge</a> e, GML_pair* list);
<a name="l00740"></a>00740 
<a name="l00749"></a>00749     <span class="keyword">virtual</span> <span class="keywordtype">void</span> load_graph_info_handler (GML_pair* list);
<a name="l00750"></a>00750 
<a name="l00751"></a>00751 <span class="keyword">private</span>:
<a name="l00752"></a>00752 
<a name="l00753"></a>00753     <span class="comment">//================================================== Flags</span>
<a name="l00754"></a>00754     
<a name="l00755"></a>00755     <span class="keyword">mutable</span> <span class="keywordtype">bool</span> directed;
<a name="l00756"></a>00756 
<a name="l00757"></a>00757     <span class="comment">//================================================== Visible Nodes/Edges</span>
<a name="l00758"></a>00758     
<a name="l00759"></a>00759     list&lt;node&gt; nodes;
<a name="l00760"></a>00760     list&lt;edge&gt; edges;
<a name="l00761"></a>00761     <span class="keywordtype">int</span> nodes_count, edges_count;
<a name="l00762"></a>00762 
<a name="l00763"></a>00763     <span class="comment">//================================================== Hidden Nodes/Edges</span>
<a name="l00764"></a>00764     
<a name="l00765"></a>00765     list&lt;node&gt; hidden_nodes;
<a name="l00766"></a>00766     list&lt;edge&gt; hidden_edges;
<a name="l00767"></a>00767     <span class="keywordtype">int</span> hidden_nodes_count, hidden_edges_count; 
<a name="l00768"></a>00768 
<a name="l00769"></a>00769     <span class="comment">//================================================== Node/edge numbering</span>
<a name="l00770"></a>00770 
<a name="l00771"></a>00771     <span class="keywordtype">int</span> new_node_id();
<a name="l00772"></a>00772     <span class="keywordtype">int</span> new_edge_id();
<a name="l00773"></a>00773 
<a name="l00774"></a>00774     <span class="comment">//================================================== Copy </span>
<a name="l00775"></a>00775     
<a name="l00776"></a>00776     <span class="keywordtype">void</span> copy (<span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G, 
<a name="l00777"></a>00777         list&lt;node&gt;::const_iterator it, 
<a name="l00778"></a>00778         list&lt;node&gt;::const_iterator end);
<a name="l00779"></a>00779 
<a name="l00780"></a>00780 <span class="keyword">public</span>: <span class="comment">// needs to be public, because template friends are not possible</span>
<a name="l00784"></a>00784 <span class="comment"></span>    <span class="keywordtype">int</span> number_of_ids(<a class="code" href="a00020.html" title="A node in a graph.">node</a>) <span class="keyword">const</span>;
<a name="l00785"></a>00785     
<a name="l00789"></a>00789     <span class="keywordtype">int</span> number_of_ids(<a class="code" href="a00010.html" title="An edge in a graph.">edge</a>) <span class="keyword">const</span>;
<a name="l00790"></a>00790     
<a name="l00791"></a>00791 <span class="keyword">private</span>:
<a name="l00792"></a>00792     list&lt;int&gt; free_node_ids;
<a name="l00793"></a>00793     list&lt;int&gt; free_edge_ids;
<a name="l00794"></a>00794     <span class="keywordtype">int</span> free_node_ids_count, free_edge_ids_count;
<a name="l00795"></a>00795 
<a name="l00796"></a>00796     <span class="comment">//================================================== utilities</span>
<a name="l00797"></a>00797     
<a name="l00798"></a>00798     <span class="keywordtype">void</span> del_list(list&lt;node&gt; &amp;);
<a name="l00799"></a>00799     <span class="keywordtype">void</span> del_list(list&lt;edge&gt; &amp;);
<a name="l00800"></a>00800 
<a name="l00801"></a>00801     GTL_EXTERN <span class="keyword">friend</span> ostream&amp; operator&lt;&lt; (ostream&amp; os, <span class="keyword">const</span> <a class="code" href="a00014.html" title="A directed or undirected graph.">graph</a>&amp; G);
<a name="l00802"></a>00802 };
<a name="l00803"></a>00803 
<a name="l00804"></a>00804 __GTL_END_NAMESPACE
<a name="l00805"></a>00805 
<a name="l00806"></a>00806 <span class="comment">//--------------------------------------------------------------------------</span>
<a name="l00807"></a>00807 <span class="comment">//   Iteration</span>
<a name="l00808"></a>00808 <span class="comment">//--------------------------------------------------------------------------</span>
<a name="l00809"></a>00809 
<a name="l00810"></a>00810 <span class="preprocessor">#define forall_nodes(v,g) GTL_FORALL(v,g,graph::node_iterator,nodes_)</span>
<a name="l00811"></a>00811 <span class="preprocessor"></span><span class="preprocessor">#define forall_edges(v,g) GTL_FORALL(v,g,graph::edge_iterator,edges_)</span>
<a name="l00812"></a>00812 <span class="preprocessor"></span>    
<a name="l00813"></a>00813 <span class="preprocessor">#endif // GTL_GRAPH_H</span>
<a name="l00814"></a>00814 <span class="preprocessor"></span>
<a name="l00815"></a>00815 <span class="comment">//--------------------------------------------------------------------------</span>
<a name="l00816"></a>00816 <span class="comment">//   end of file</span>
<a name="l00817"></a>00817 <span class="comment">//--------------------------------------------------------------------------</span>
</pre></div>    <p class="links">
      <a href="http://www.uni-passau.de/">University of Passau</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/">FMI</a>
      &nbsp;-&nbsp;
      <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
	Computer Science</a>
    </p>
  <div class="copyright">
      Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>,  University of Passau 
  </div>
</body>
</html>
